package com.gismore.demo.web;

import org.springframework.batch.core.*;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by lei on 2017/6/9.
 */
@Controller
public class JobLauncherController {

	@Autowired
	JobLauncher jobLauncher;

	@Autowired
	Job helloJob;

	@RequestMapping("/runJob")
	public void handle() throws Exception{
		jobLauncher.run(helloJob, new JobParameters());
	}
}
